package cn.qzuie.smart.module.dorm.dal.mysql.billpay;

import java.util.*;

import cn.qzuie.smart.framework.common.pojo.PageResult;
import cn.qzuie.smart.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.qzuie.smart.framework.mybatis.core.mapper.BaseMapperX;
import cn.qzuie.smart.module.dorm.dal.dataobject.billpay.BillPayDO;
import org.apache.ibatis.annotations.Mapper;
import cn.qzuie.smart.module.dorm.controller.admin.billpay.vo.*;

/**
 * 账单支付 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface BillPayMapper extends BaseMapperX<BillPayDO> {

    default PageResult<BillPayDO> selectPage(BillPayPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BillPayDO>()
                .eqIfPresent(BillPayDO::getBillId, reqVO.getBillId())
                .eqIfPresent(BillPayDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BillPayDO::getPaidAmount, reqVO.getPaidAmount())
                .eqIfPresent(BillPayDO::getPaymentMethod, reqVO.getPaymentMethod())
                .betweenIfPresent(BillPayDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BillPayDO::getId));
    }

}